package com.ibeeking.found.msg.service.common.enums;

public enum PriorityLevelEnum {
    LEVEL_LOW("低", 1),
    LEVEL_MID("中", 2),
    LEVEL_HIGTH("高", 3),;

    private String name;
    private Integer level;

    PriorityLevelEnum(String name, Integer level) {
        this.name = name;
        this.level = level;
    }

    public String getName() {
        return name;
    }

    public Integer getLevel() {
        return level;
    }

    public static String getNameByLevel(Integer level) {
        for (PriorityLevelEnum enumObj : values()) {
            if (enumObj.getLevel().equals(level)) {
                return enumObj.getName();
            }
        }
        return null;
    }

    public static PriorityLevelEnum getEnumByLevel(Integer level) {
        for (PriorityLevelEnum enumObj : values()) {
            if (enumObj.getLevel().equals(level)) {
                return enumObj;
            }
        }
        return null;
    }
}
